import json
import os
import numpy as np
from flask import request
from flask.templating import render_template
from flask import Flask
from flask import g


app = Flask(__name__,template_folder='./template',static_folder='./static',static_url_path='/static')
app.config['SECRET_KEY'] = os.urandom(24)

@app.route('/spider',methods=['POST'])
def spider():
    # data = request.body
    search = request.data
    files = request.files
    return json.dumps('hello')
@app.route('/',methods=['GET'])
def index():
    data = np.random.randint(1500,3000,size=(1,20))[0]
    return render_template(
        'index.html',
        data=list(data)
    )

@app.route('/slide?post=<int:sign>',methods=['GET'])
def slide(sign):
    return f'sign: {sign}'
if __name__ =='__main__':
    app.run(host='127.0.0.1',port=8000)